package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.TaskInfoDao;
import cn.topevery.garden.entity.po.TaskInfo;
import cn.topevery.garden.entity.query.TaskInfoQuery;
import cn.topevery.garden.entity.vo.TaskInfoVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 任务信息
 *
 * @author code-generate
 * @date 2021-08-26
 */
@Service
public class TaskInfoLogic extends BaseLogic<TaskInfo> {
    @Autowired
    TaskInfoDao taskInfoDao;

    @Override
    public BaseEntityDao<TaskInfo, Integer> getDao() {
        return taskInfoDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<TaskInfoVO> listPage(TaskInfoQuery query) {
        return taskInfoDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        taskInfoDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param taskInfo 实体
     */
    public void saveOrUpdate(String userId, TaskInfo taskInfo){
        taskInfoDao.saveOrUpdate(userId,taskInfo);
    }
}
